<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">
	<h:form>
		<p:dialog header="#{msg['index.optionsPopupTitle']}" widgetVar="dlg"
			resizable="false" modal="true" draggable="false" showEffect="explode" hideEffect="explode">
			<h:panelGrid columns="1">
				<h:outputText value="#{msg['index.selectLanguage']}" />
				<p:selectOneMenu value="#{index.selectedLanguage}"
					valueChangeListener="#{index.localeChanged}">
					<f:selectItems value="#{index.availableLocales}" />
				</p:selectOneMenu>

				<h:outputText value="#{msg['index.selectTrainCorpus']}" />
				<p:selectOneRadio value="#{index.selectedTrainCorpus}">
					<f:selectItem itemValue="newsgroups" itemLabel="20Newsgroups" />
					<f:selectItem itemValue="reuters" itemLabel="Reuters" />
				</p:selectOneRadio>

				<h:outputText value="#{msg['index.selectAlgorithm']}" />
				<p:selectOneRadio id="selectedAlgorithm"
					value="#{index.selectedAlgorithm}">
					<f:selectItem itemValue="rocchio"
						itemLabel="#{msg['index.rocchio']}" />
					<f:selectItem itemValue="bayes"
						itemLabel="#{msg['index.naiveBayes']}" />
					<f:ajax listener="#{index.algorithmSelected}"
						render="rocchioParameters" />
				</p:selectOneRadio>

				<h:panelGroup id="rocchioParameters">
					<h:panelGroup rendered="#{index.rocchioParametersVisible}">
						<h:outputText value="#{msg['index.rocchioAlgorithmParameters']}" />
						<h:panelGrid columns="2">
							<h:outputText value="#{msg['index.alfa']}" />
							<p:inputText size="4" value="#{index.alfa}" />

							<h:outputText value="#{msg['index.beta']}" />
							<p:inputText size="4" value="#{index.beta}" />
						</h:panelGrid>
					</h:panelGroup>
				</h:panelGroup>
			</h:panelGrid>
			<h:panelGrid columns="3">
				<p:commandButton value="#{msg['index.train']}"
					actionListener="#{index.train}" />
				<p:commandButton value="#{msg['index.saveOptions']}"
					update=":display" oncomplete="dlg.hide();" />
			</h:panelGrid>
		</p:dialog>
	</h:form>
</ui:composition>